package com.wxyzz.satserver.message.controller;


import com.wxyzz.common.core.common.R;
import com.wxyzz.satserver.message.service.IMessageSessionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wyz
 * @since 2024-11-15
 */
@RestController
@RequestMapping("/messagesession")
@Api(tags ="聊天会话api")
@CrossOrigin
public class MessageSessionController {
    @Resource
    private IMessageSessionService messageSessionService;

    @GetMapping("/sessionList")
    @ApiOperation(value = "获取会话列表")
    public R getMessageSessionList(){
      return R.ok( messageSessionService.getMessageSessionList());
    }

    @PostMapping("/addsession")
    @ApiOperation(value = "创建会话")
    public R addMessageSession(int toUserId){
       return R.ok(messageSessionService.addMessageSession(toUserId));
    }


}
